﻿<UserControl x:Class="KoRepOnlineSales3.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit"
    xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    mc:Ignorable="d"
    d:DesignHeight="720" d:DesignWidth="900" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">
    
    <Grid x:Name="LayoutRoot" Background="White">
        
        <StackPanel>
            
            <StackPanel.Resources>
                <Storyboard x:Name="myStoryboard">
                    <!-- Blur the Button and then animate back to normal. -->
                    <DoubleAnimation
                         Storyboard.TargetName="myBlurBitmapEffect"
                         Storyboard.TargetProperty="Radius"
                         From="0" To="40" Duration="0:0:0.4"
                         AutoReverse="True" />
                    <DoubleAnimation
                         Storyboard.TargetName="myBlurBitmapEffect2"
                         Storyboard.TargetProperty="Radius"
                         From="0" To="40" Duration="0:0:1.7"
                         AutoReverse="True" />
                    <DoubleAnimation
                         Storyboard.TargetName="myBlurBitmapEffect3"
                         Storyboard.TargetProperty="Radius"
                         From="0" To="40" Duration="0:0:0.3"
                         AutoReverse="True" />
                </Storyboard>
            </StackPanel.Resources>

            <Grid Name="stackPanel_Head" Height="30" Background="Beige" VerticalAlignment="Bottom">

                <TextBlock Name="lblTitle" Text="Отчет - Онлайн продажи" Height="28" Width="160" Margin="4,4,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" />
                
                <basics:DatePicker Name="oDate" Width="115" Height="23" Margin="169,4,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" SelectedDateChanged="oDate_SelectedDateChanged"></basics:DatePicker>
                
                <Button x:Name="btnGo" Content="Обновить" Click="btnGo_Click" Width="80" Margin="300,5,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" >
                    <Button.Effect>
                        <BlurEffect x:Name="myBlurBitmapEffect" Radius="0" />
                    </Button.Effect>
                </Button>
                
                <Image Height="30" HorizontalAlignment="Left" Margin="386,0,0,0" Name="imgLogo" VerticalAlignment="Top" Width="107" Source="http://sp.korablik.local/images/download.jpg" >
                    <Image.Effect>
                        <BlurEffect x:Name="myBlurBitmapEffect2" Radius="0" />
                    </Image.Effect>
                </Image>

                <ComboBox Name="mShopsRegions" 
                          Width="108" 
                          VerticalAlignment="Top" HorizontalAlignment="Left" 
                          Margin="495,5,0,0" 
                          SelectionChanged="mShopsRegions_SelectionChanged" >
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <CheckBox Name="ShopCheck" IsChecked="{Binding Checked, Mode=TwoWay}" Content="{Binding Name}" Click="ShopCheck_Click">
                            </CheckBox>
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>

                <ComboBox Name="mShops" 
                          Width="200" 
                          VerticalAlignment="Top" HorizontalAlignment="Left" 
                          Margin="604,5,0,0">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <CheckBox Name="ShopCheck" 
                                IsChecked="{Binding Checked, Mode=TwoWay}" Content="{Binding Name}" Checked="ShopCheck_Checked" Click="ShopCheck_Click_1">
                            </CheckBox>
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>

                <TextBlock Height="28" Width="130" Name="lblTotal" Margin="0,-1,2,0" VerticalAlignment="Top" HorizontalAlignment="Right" Cursor="Arrow" FontWeight="Black" >
                    <TextBlock.Effect>
                        <BlurEffect x:Name="myBlurBitmapEffect3" Radius="0" />
                    </TextBlock.Effect>
                </TextBlock>
            </Grid>

            <data:DataGrid 
                Name="dataGrid1"
                AutoGenerateColumns="False" 
                ScrollViewer.HorizontalScrollBarVisibility="Auto"
                ScrollViewer.VerticalScrollBarVisibility="Auto"
                Height="350" Width="auto"
                HorizontalAlignment="Left" 
                VerticalAlignment="Top"
                Margin="0,2,0,2" 
                IsReadOnly="True" 
                SelectionChanged="dataGrid1_SelectionChanged"
            >
                <data:DataGrid.Columns>
                    <data:DataGridTextColumn Width="0.3*" Header="Магазин" Binding="{Binding ShopName}" />
                    <data:DataGridTextColumn Width="0.14*" Header="Касса 1" Binding="{Binding kassa1}">
                        <data:DataGridTextColumn.ElementStyle>
                            <Style TargetType="TextBlock">
                                <Setter Property="TextAlignment" Value="Right" />
                            </Style>
                        </data:DataGridTextColumn.ElementStyle>
                    </data:DataGridTextColumn>
                    <data:DataGridTextColumn Width="0.14*" Header="Касса 2" Binding="{Binding kassa2}">
                        <data:DataGridTextColumn.ElementStyle>
                            <Style TargetType="TextBlock">
                                <Setter Property="TextAlignment" Value="Right" />
                            </Style>
                        </data:DataGridTextColumn.ElementStyle>
                    </data:DataGridTextColumn>
                    <data:DataGridTextColumn Width="0.14*" Header="Касса 3" Binding="{Binding kassa3}">
                        <data:DataGridTextColumn.ElementStyle>
                            <Style TargetType="TextBlock">
                                <Setter Property="TextAlignment" Value="Right" />
                            </Style>
                        </data:DataGridTextColumn.ElementStyle>
                    </data:DataGridTextColumn>
                    <data:DataGridTextColumn Width="0.14*" Header="Касса 4" Binding="{Binding kassa4}">
                        <data:DataGridTextColumn.ElementStyle>
                            <Style TargetType="TextBlock">
                                <Setter Property="TextAlignment" Value="Right" />
                            </Style>
                        </data:DataGridTextColumn.ElementStyle>
                    </data:DataGridTextColumn>
                    <data:DataGridTextColumn Width="0.14*" Header="Итого"  Binding="{Binding total}">
                        <data:DataGridTextColumn.ElementStyle>
                            <Style TargetType="TextBlock">
                                <Setter Property="TextAlignment" Value="Right" />
                            </Style>
                        </data:DataGridTextColumn.ElementStyle>
                    </data:DataGridTextColumn>
                </data:DataGrid.Columns>
            </data:DataGrid>

            <Grid Height="73" Name="stackPanel_Bottom"  Background="Beige" VerticalAlignment="Bottom">
                <TextBlock 
                    Name="txtBottom"
                    Height="65" 
                    Width="541"
                    Margin="4,2,0,0"
                    Text="TextBlock" 
                    HorizontalAlignment="Left"
                    VerticalAlignment="Top" 
                />
                <CheckBox 
                    Name="oAutoRefresh" 
                    Content="Автоматически обновлять" 
                    IsChecked="True"
                    Height="16" Margin="551,1,0,0"
                    HorizontalAlignment="Left" VerticalAlignment="Top" />
                <TextBlock Text="каждые" Margin="555,38,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="50" MinWidth="50" />

                <TextBox Name="txtRefreshInterval" Height="23" HorizontalAlignment="Left" Margin="605,34,0,0" VerticalAlignment="Top" Width="49" Text="5" TextAlignment="Left" TextChanged="txtRefreshInterval_TextChanged" />
                <ScrollBar Name="scrollBar1" Height="36" Margin="656,26,0,0" VerticalAlignment="Top" Value="5" ValueChanged="scrollBar1_ValueChanged" Minimum="1" Maximum="1024" HorizontalAlignment="Left" Width="38" SmallChange="1" Orientation="Horizontal" />
                <TextBlock HorizontalAlignment="Left" Margin="698,38,0,0" MinWidth="30" Text="мин." VerticalAlignment="Top" Width="30" />
            </Grid>

            <Grid Height="Auto" Name="stackPanel_Log" Background="#FFE1FFFF" VerticalAlignment="Bottom">
                <ListBox Name="Log" 
                         MinHeight="30" MinWidth="800" MaxHeight="120"
                         VerticalAlignment="Top" HorizontalAlignment="Left" 
                         ScrollViewer.HorizontalScrollBarVisibility="Auto"
                         ScrollViewer.VerticalScrollBarVisibility="Auto"
                         Background="Transparent" />
            </Grid>

            <Grid Height="73" 
                  Name="stackPanel_Err" Visibility="Collapsed"
                  Background="#FFF0001E" VerticalAlignment="Bottom">
                <TextBlock 
                    Name="txtBottomErrMsg"
                    Height="61" 
                    Width="541"
                    Margin="4,2,0,0"
                    Text="Error Msg : " 
                    HorizontalAlignment="Left"
                    VerticalAlignment="Top" Foreground="#FFF5E43C" />
            </Grid>

        </StackPanel>
        
        <TextBlock 
            Name="txtSecReal" 
            Text="1" 
            HorizontalAlignment="Left" VerticalAlignment="Top"
            Margin="726,386,0,0" MinWidth="30" Width="30" />
        <TextBlock HorizontalAlignment="Right" VerticalAlignment="Top"
            FontFamily="Verdana"
            FontSize="24"
            FontWeight="Bold" 
            Foreground="Black"
            Text="Online" 
            Margin="0,10,0,0">
            <TextBlock.RenderTransform>
                <TranslateTransform X="2" Y="2" />
            </TextBlock.RenderTransform>
        </TextBlock>
        <TextBlock HorizontalAlignment="Right" VerticalAlignment="Top"
            FontFamily="Verdana"
            FontSize="24"
            FontWeight="Bold" 
            Foreground="Coral"
            Margin="0,10,0,0"
            Text="Online" Height="24" />
        <Button Name="button1" Content="Excl" Height="23" Width="32" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="806,3,0,0" Click="button1_Click">
            <ToolTipService.ToolTip>
                <ToolTip Content="Export to Excel"></ToolTip>
            </ToolTipService.ToolTip>
        </Button>
    </Grid>
    
</UserControl>
